import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.12

Page {
	property alias navigate_tabbar: navigate_tabbar
	id: main_stackview_page
	SwipeView {
		id: navigate_swipeview
		anchors.fill: parent
		currentIndex: navigate_tabbar.currentIndex
		DataSwipeView {}
		HomeSwipeView {}
		ProfileSwipeView {}
	}
	footer: TabBar {
		id: navigate_tabbar
		Material.background: "#EEEEEE"
		currentIndex: navigate_swipeview.currentIndex
		TabButton {
            icon.source: "./Images/drawable/bar_chart-black-24dp.svg"
            text: qsTr("室外数据")
		}
		TabButton {
            id: home_tabbutton
            icon.source: "./Images/drawable/home-black-24dp.svg"
            text: qsTr("室内设置")
		}
		TabButton {
            icon.source: "./Images/drawable/person-black-24dp.svg"
            text: qsTr("个人中心")
		}
		onCurrentIndexChanged: {
			if (currentIndex == 0) {
				toolbar_title_label.text = "室外数据"
			} else if (currentIndex == 1) {
				toolbar_title_label.text = "室内设置"
			} else if (currentIndex == 2) {
				toolbar_title_label.text = "个人中心"
			}
		}
	}
	Component.onCompleted: navigate_swipeview.setCurrentIndex(1)
}

/*##^##
Designer {
	D{i:0;autoSize:true;height:480;width:640}
}
##^##*/

